Optimal. Leaf size=135 \[ \frac {c^3 (-B+i A) (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {4 i B c^3}{a^3 f (-\tan (e+f x)+i)}-\frac {2 B c^3}{a^3 f (-\tan (e+f x)+i)^2}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {i B c^3 x}{a^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3588, 78, 43} \[ \frac {c^3 (-B+i A) (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {4 i B c^3}{a^3 f (-\tan (e+f x)+i)}-\frac {2 B c^3}{a^3 f (-\tan (e+f x)+i)^2}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {i B c^3 x}{a^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 43
Rule 78
Rule 3588
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {(A+B x) (c-i c x)^2}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {(i B c) \operatorname {Subst}\left (\int \frac {(c-i c x)^2}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {(i B c) \operatorname {Subst}\left (\int \left (\frac {4 i c^2}{a^3 (-i+x)^3}+\frac {4 c^2}{a^3 (-i+x)^2}-\frac {i c^2}{a^3 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i B c^3 x}{a^3}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {2 B c^3}{a^3 f (i-\tan (e+f x))^2}-\frac {4 i B c^3}{a^3 f (i-\tan (e+f x))}+\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.92, size = 145, normalized size = 1.07 \[ \frac {c^3 \sec ^3(e+f x) (-\cos (3 (e+f x)) (A-6 i B \log (\cos (e+f x))-6 B f x+i B)+i A \sin (3 (e+f x))+9 B \sin (e+f x)-B \sin (3 (e+f x))+6 i B f x \sin (3 (e+f x))-3 i B \cos (e+f x)-6 B \sin (3 (e+f x)) \log (\cos (e+f x)))}{6 a^3 f (\tan (e+f x)-i)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.57, size = 103, normalized size = 0.76 \[ \frac {{\left (-12 i \, B c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, B c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 6 \, B c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, B c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, A - B\right )} c^{3}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6 \, a^{3} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 3.26, size = 255, normalized size = 1.89 \[ \frac {\frac {30 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{3}} - \frac {60 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{3}} + \frac {30 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{3}} + \frac {147 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 60 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 942 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 200 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3620 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 60 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 942 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 \, B c^{3}}{a^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}}}{30 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.24, size = 164, normalized size = 1.21 \[ \frac {2 i c^{3} A}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {4 c^{3} B}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {5 i c^{3} B}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )}+\frac {c^{3} A}{f \,a^{3} \left (\tan \left (f x +e \right )-i\right )}-\frac {4 i c^{3} B}{3 f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{3}}-\frac {4 c^{3} A}{3 f \,a^{3} \left (\tan \left (f x +e \right )-i\right )^{3}}-\frac {c^{3} B \ln \left (\tan \left (f x +e \right )-i\right )}{f \,a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.96, size = 149, normalized size = 1.10 \[ -\frac {c^3\,\left (18\,B\,\mathrm {tan}\left (e+f\,x\right )-B\,7{}\mathrm {i}-A-B\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,3{}\mathrm {i}+3\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,15{}\mathrm {i}+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,9{}\mathrm {i}-3\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )+9\,B\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\right )\,1{}\mathrm {i}}{3\,a^3\,f\,{\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.91, size = 258, normalized size = 1.91 \[ - \frac {2 i B c^{3} x}{a^{3}} + \frac {B c^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} + \begin {cases} - \frac {\left (12 B a^{6} c^{3} f^{2} e^{10 i e} e^{- 2 i f x} - 6 B a^{6} c^{3} f^{2} e^{8 i e} e^{- 4 i f x} + \left (- 2 i A a^{6} c^{3} f^{2} e^{6 i e} + 2 B a^{6} c^{3} f^{2} e^{6 i e}\right ) e^{- 6 i f x}\right ) e^{- 12 i e}}{12 a^{9} f^{3}} & \text {for}\: 12 a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (\frac {2 i B c^{3}}{a^{3}} + \frac {i \left (- i A c^{3} - 2 B c^{3} e^{6 i e} + 2 B c^{3} e^{4 i e} - 2 B c^{3} e^{2 i e} + B c^{3}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________